package com.zjun.demo.experimentaldemo.lifecycle

import android.annotation.SuppressLint
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.zjun.demo.experimentaldemo.R
import com.zjun.demo.experimentaldemo.databinding.ActivityViewLifecycleBinding

/**
 * 打印viewLifecycleOwner的生命周期
 */
class ViewLifecycleActivity : AppCompatActivity() {

    private lateinit var binding:ActivityViewLifecycleBinding

    @SuppressLint("CommitTransaction")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = DataBindingUtil.setContentView(this,R.layout.activity_view_lifecycle)
        supportFragmentManager.beginTransaction().add(binding.container.id,BlankFragment.newInstance()).commit()
    }

}